<template>
	<view class="pagesContent">
		<view class="pagesContentView">
			<view class="title">请输入您的意见或建议</view>
			<view class="form">
				<textarea class="textarea" v-model="message" maxlength="-1" placeholder="请输入您的意见或建议"
					placeholder-style="color:#616163" placeholder-class="textareaPla" />
			</view>
		</view>
		<view class="btn btnDisable" v-if="!disable">提交</view>
		<view class="btn" v-else @click="up">提交</view>
		<view class="" style="height: 20rpx;"> </view>
		<adView></adView>
	</view>
</template>
<script>
	import {
		mapGetters,
		mapMutations,
		mapActions
	} from 'vuex';
	export default {
		data() {
			return {
				message: "",
			}
		},
		computed: {
			disable() {
				return this.message.length > 0
			}
		},
		methods: {
			back() {
				uni.navigateBack({
					delta: 1
				})
			},
			up() {
				if (this.message == "") {
					this.text("请输入反馈描述")
					return
				}
				uni.showLoading({
					mask: true
				})

				let params = {
					content: this.message,


				}
				this.$http.post("/api/user/feedback", params).then(res => {
					uni.hideLoading()
					if (res.code == 0) {
						this.text("提交成功")
						this.message = ""
						setTimeout(() => {
							uni.navigateBack({
								delta: 1
							})
						}, 1500)

					} else {
						this.text(res.msg)
					}

				}).catch(err => {
					uni.hideLoading()
					this.text(err.message)
				})
			},


		}



	}
</script>
<style lang="scss" scoped>
	.pagesContent {

		padding-top: 61.54rpx;
		height: 100vh;
		background: linear-gradient(180deg, #E1EBFF 0%, #FAFCFF 100%);
		overflow: hidden;

		.pagesContentView {
			width: 626.92rpx;
			height: 453.85rpx;
			background-color: #ffffff;
			border-radius: 15.38rpx;
			margin: 0 auto 61.54rpx;
			padding: 30.77rpx 23.08rpx 23.08rpx;

			.title {
				height: 46.15rpx;
				font-size: 30.77rpx;
				font-weight: 600;
				color: #404040;
				line-height: 46.15rpx;
				margin-bottom: 15.38rpx;
			}

			.form {
				margin: 0 auto;
				width: 580.77rpx;
				height: 338.46rpx;
				padding: 23.08rpx;
				overflow: hidden;
				border-radius: 15.38rpx;
				background-color: #F7F7F7;

				.textarea {
					width: 580.77rpx;
					height: 338.46rpx;
					font-size: 26.92rpx;
					color: #000000;
				}

				.textareaPla {
					color: #B8B8B8;
				}
			}
		}

		.btn {
			width: 673.08rpx;
			height: 92.31rpx;
			background: #3970FF;
			border-radius: 46.15rpx;
			line-height: 92.31rpx;
			text-align: center;
			font-size: 32.69rpx;
			font-weight: 600;
			color: #ffffff;
			margin: 0 auto 38.46rpx;
		}



		.btnDisable {
			opacity: 0.5;

		}
	}
</style>